home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Mark Pilgrim / Jotto ][ 1.2 / source / Wipes ƒ / HGR2.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-10-30  |  942 b   |  38 lines  |  [TEXT/MMCC]

  1. #include "timing.h"
  2.  
  3. #define CorrectTime 4
  4. #define theWindowWidth (boundsRect.right-boundsRect.left)
  5. #define theWindowHeight (boundsRect.bottom-boundsRect.top)
  6.  
  7. pascal short HGR2(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect);
  8.  
  9. /* Copy even-numbered rows starting at the top and moving down, and copy odd-
  10.    numbered rows starting at the bottom and moving up. */
  11.    
  12. pascal short HGR2(GrafPtr sourceGrafPtr, GrafPtr destGrafPtr, Rect boundsRect)
  13. {
  14.     Rect            thisone;
  15.     short                i;
  16.     short                numCols;
  17.     
  18.     numCols=theWindowWidth/24;
  19.     for (i=0; i<numCols; i++)
  20.     {
  21.         StartTiming();
  22.         
  23.         SetRect(&thisone, boundsRect.left+i, boundsRect.top, boundsRect.left+i+1,
  24.             boundsRect.bottom);
  25.         
  26.         while (thisone.left<boundsRect.right)
  27.         {
  28.             CopyBits(&(sourceGrafPtr->portBits), &(destGrafPtr->portBits),
  29.                 &thisone, &thisone, 0, 0L);
  30.             thisone.left+=numCols;
  31.             thisone.right+=numCols;
  32.         }
  33.         TimeCorrection(CorrectTime);
  34.     }
  35.     
  36.     return 0;
  37. }
  38.